package com.example.tb_base

import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel

abstract class BaseViewModel<T : BaseRepository> : ViewModel() {
    protected val repository: T by lazy {
        createRepository()
    }
    val loadingDataState: LiveData<LoadingState> by lazy {
        repository.loadingStateLiveData
    }

    abstract fun createRepository(): T
}